Skip to content

[skip changelog] Fix core search tests #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

silvanocerza
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce?

A small fix in the integration tests.

  • What is the current behavior?

Tests might fail some times if indexes update is slower than usual.

  • What is the new behavior?

Tests should not fail anymore if indexes update is slow.

  • Does this PR introduce a breaking change?

No.

  • Other information:

None.


See how to contribute

@silvanocerza silvanocerza requested review from cmaglie and rsora October 28, 2020 14:58
@silvanocerza silvanocerza self-assigned this Oct 28, 2020
@silvanocerza silvanocerza force-pushed the scerza/fix-test-core-search branch 2 times, most recently from b9c6b9c to 3e07fbe Compare October 28, 2020 16:01
assert ["Updating", "index:", "package_index.json", "downloaded"] in lines
assert ["Updating", "index:", "package_index.json.sig", "downloaded"] in lines
assert ["Retrokits-RK002:arm", "1.0.5", "RK002"] in lines
assert ["Retrokits-RK002:arm", "1.0.6", "RK002"] in lines
header_index = lines.index(["ID", "Version", "Name"])
assert 2 == len(lines[header_index + 1 :])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert 2 == len(lines[header_index + 1 :])
assert 2 == len(lines[(header_index + 1):])

What do you think about doing this instead, and then leaving the E203 flake8 check intact? It seems easier to understand to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wouldn't work, black would format it as lines[(header_index + 1) :] so flake8 complains anyway.

@silvanocerza silvanocerza force-pushed the scerza/fix-test-core-search branch from 3e07fbe to c8895d2 Compare October 30, 2020 17:00
lines = [l.strip().split() for l in result.stdout.strip().splitlines()]
assert ["Updating", "index:", "package_index.json", "downloaded"] in lines
assert ["Updating", "index:", "package_index.json.sig", "downloaded"] in lines
assert ["Package:x86", "1.2.3", "Platform"] in lines
assert 1 == len(lines[header_index + 1 :]) # noqa: E203
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document what # noqa: E203 does. At least in the commit message. Thanks!

@silvanocerza silvanocerza force-pushed the scerza/fix-test-core-search branch from c8895d2 to 8408ef1 Compare November 2, 2020 08:52
@silvanocerza silvanocerza merged commit f1ca408 into master Nov 2, 2020
@silvanocerza silvanocerza deleted the scerza/fix-test-core-search branch November 2, 2020 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants